using UnityEngine;
using System.Collections;

public static class ConstructionController {
	
	static int startX, startY, startZ;
	static int endX, endY, endZ;
	static bool firstCoordsAssigned;
	
	public static void Update(){
		if (Input.GetMouseButtonDown(0)){
			if (!firstCoordsAssigned){
				startX = (int)(Input.mousePosition.x);
				startY = (int)(Input.mousePosition.y);
				startZ = (int)(Input.mousePosition.z);
				
				firstCoordsAssigned = true;
				
			} else {
				
				endX = (int)(Input.mousePosition.x);
				endY = (int)(Input.mousePosition.y);
				endZ = (int)(Input.mousePosition.z);
				
				firstCoordsAssigned = false;
				new TrackConstructionJob(startX, startY, startZ, endX, endY, endZ);
				
				Debug.Log("sX: " +startX + " sY: " + startY + " sZ: " + startZ + 
					" eX: " +endX + " eY: " + endY + " eZ: " + endZ);
			}
		}
	}
}
